<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>vue事件参数传递</title>
    <script src="./js/vue.js"></script>
</head>
<body>
    <div id="app">
        <h2>{{msg}}</h2>
        <h2>{{count}}</h2>
        <h2>用户名：{{user.name}}；性别：{{user.sex}}</h2>
        <button @click="changeCount(5,'zs','男')">改变count为指定值</button>
    </div>
</body>
</html>
<script>
    new Vue({
        el: '#app',
        data: {
            msg: 'vue事件参数传递',
            count: 0,
            user:{}
        },
        methods: {
            // 点击修改count的值
            changeCount(num,...user){
                this.count = num;
                this.user.name = user[0];
                this.user.sex = user[1];
            }
        }
    })

</script>
